<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>1正则表达式</title>
	</head>
	<body>
		哈哈
	</body>
	<script>
		
		var pattern =/box/i;
		var str = "this is a Box";
		alert(pattern.test(str));//true
		alert(pattern.exec(str));//Box
	</script>
</html>
